assistant: Avoid tripping template tests
authorMatthias Clasen <mclasen@redhat.com>
Wed, 27 Jan 2016 17:57:58 +0000 (12:57 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 27 Jan 2016 18:09:40 +0000 (13:09 -0500)
We need to unset the titlebar manually before chaining up
in destroy, otherwise we trigger the template invariant
checking - GtkWindow would eventually unset it, but too late
for the invariants checking code in gtk_widget_destroy.

gtk/gtkassistant.c

index c66bc0f8bd0c671411d0cc77eeab223517c02ca3..d8d7329144519dd9a87626e3e0454f6acee899e2 100644 (file)
@@ -303,7 +303,7 @@ apply_use_header_bar (GtkAssistant *assistant)
   gtk_widget_set_visible (priv->headerbar, priv->use_header_bar);
   if (!priv->use_header_bar)
     gtk_window_set_titlebar (GTK_WINDOW (assistant), NULL);
-  if (priv->use_header_bar)
+  else
     g_signal_connect (priv->action_area, "add", G_CALLBACK (add_cb), assistant);
 }
 
@@ -1365,6 +1365,7 @@ gtk_assistant_destroy (GtkWidget *widget)
       priv->visited_pages = NULL;
     }
 
+  gtk_window_set_titlebar (GTK_WINDOW (widget), NULL);
   GTK_WIDGET_CLASS (gtk_assistant_parent_class)->destroy (widget);
 }